Effects of Economy, natural resources distribution, government policies on CO2 emissions by countries ¶

Authors:

Ramolia Harshit, IIT Gandhinagar, ramolia.mh@iitgn.ac.in

Muhammad Yusuf Hassan, IIT Gandhinagar, md.hassan@iitgn.ac.in

In [1]:
from IPython.display import HTML
HTML('''<button type="button" onclick="codeToggle();">Toggle Code</button>''')
In [2]:
import warnings
warnings.filterwarnings('ignore')
In [3]:
import pycountry
import pandas as pd
import plotly.express as px
In [4]:
def is_country(name):
    try:
        pycountry.countries.lookup(name)
        return True
    except:
        return False
In [5]:
raw_data = pd.read_csv("./data/owid-co2-data.csv")
country_data = raw_data[raw_data['country'].apply(is_country)]
world_data = raw_data[raw_data['country'] == 'World']

Summary of the Data ¶

The dataset compiled by Our World in Data contains historical data on carbon dioxide (CO2) emissions by country from 1851 to 2021, with CO2 emissions measured in million tonnes. This data includes overall CO2 emissions as well as sector-wise emissions, and is available for all countries as well as globally. Additionally, the dataset includes countries' GDPs by year, which will be useful in exploring the relationship between emissions and economic activity. Although there are other fields in the dataset, they are not relevant to our purposes.

Trend of CO2 emission ¶

In [6]:
co2_types = ["co2","coal_co2",'cement_co2','gas_co2','oil_co2','other_industry_co2']
co2_emission = world_data[["year"] + co2_types]
co2_emission = co2_emission[co2_emission["year"] > 2000]
fig = px.line(co2_emission, x="year", y=co2_types)
fig.show()

Based on the data on CO2 emissions since 2001, it can be concluded that the overall trend of CO2 emissions has been increasing each year. Although there have been some exceptions with CO2 emissions decreasing from the previous year, the trend over the long term has been linearly increasing. This trend is consistent across sectors, with CO2 emissions increasing in each sector, although the degree of change varies between sectors. For example, CO2 emissions from coal have shown greater increases, while CO2 emissions from oil have seen smaller increases, but overall the trend is positive in each sector.

Hypothesis ¶

The stronger the trend of CO2 emissions, the more harmful it can be in the long run.

This can easily be prove if we can analyze whether sectors with a stronger emission trend surpass the overall contribution of other sectors at some point.

In [7]:
temp = co2_emission.drop("year", axis=1)
df = pd.DataFrame(temp.iloc[-1] - temp.iloc[0], columns=["Change in 20 years"])
df["Change in 20 years (%)"] = df["Change in 20 years"]*100/temp.iloc[0]
df["Contribution to total emission in 2000 (%)"] = (temp.iloc[0] * 100) / temp.iloc[0]["co2"]
df["Contribution to total emission in 2020 (%)"] = (temp.iloc[-1] * 100) / temp.iloc[-1]["co2"]
print("Sector wise statistics for CO2 emission")
df.sort_values(by="Change in 20 years (%)", ascending=False)
Sector wise statistics for CO2 emission
Change in 20 years Change in 20 years (%) Contribution to total emission in 2000 (%) Contribution to total emission in 2020 (%)
cement_co2 918.260 121.731545 2.938798 4.505438
gas_co2 3148.245 65.951376 18.597382 21.338922
coal_co2 5724.341 61.849617 36.057501 40.350333
co2 11455.803 44.630595 100.000000 100.000000
other_industry_co2 83.068 38.984785 0.830129 0.797724
oil_co2 1446.490 13.921048 40.480946 31.885589

Based on the above observations, it can be concluded that there has been a positive change in CO2 emissions overall, as well as in each sector. It is notable that the change in CO2 emissions from oil production has been the least. While the change in CO2 emissions from the cement sector has been the maximum, the overall contribution of the cement sector to CO2 emissions is not currently significant. However, if the trend continues, the cement sector could become a more significant contributor in the future.

It is also noteworthy that the change in CO2 emissions from the coal sector is significant, as this sector is the largest contributor to total CO2 emissions in 2020, overtaking oil which was the biggest contributor in 2000. This trend towards increased CO2 emissions from coal highlights the potential problems that could arise in the future. This proves our hypothesis.

Effect of Economy on CO2 emission ¶

In [8]:
filtered_country_data = country_data[country_data["year"]>2000]
filtered_country_data = filtered_country_data[~filtered_country_data["co2"].apply(pd.isna)]
fig = px.scatter_geo(filtered_country_data, locations="iso_code", color="country",
                     hover_name="country", size="co2",
                     projection="natural earth", animation_frame="year", template="plotly_dark",title = "CO2 emmisions over time for all countries")
fig.show()

Looking at the chart above, it is clear that India and China have experienced a significant increase in CO2 emissions, while the United States has seen a slight decrease. Moreover, European countries have generally seen a decrease in CO2 emissions, while Asian countries have experienced an increase.

Hypothesis ¶

Based on our observation, we can develop the following hypotheses:

  • Reduction in CO2 emission is more on developed countries, while developing countries are prioritizing economic growth over reducing CO2 emissions.
  • Country with higher GDP tend to have higher CO2 emissions.

These hypotheses can be verified through various methods, such as analyzing changes in emissions over time, identifying the top contributors to CO2 emissions, and investigating the correlation between GDP and CO2 emissions.

In [9]:
df = pd.DataFrame(index=filtered_country_data["country"].unique())
data2001 = filtered_country_data[filtered_country_data["year"]==2001].set_index("country", drop=True)
data2018 = filtered_country_data[filtered_country_data["year"]==2018].set_index("country", drop=True)
df["CO2 emission in 2001"] = data2001["co2"]
df["CO2 emission in 2018"] = data2018["co2"]
df["Change in CO2 emission (%)"] = (data2018["co2"] - data2001["co2"])*100/data2001["co2"]
df["Rank by GDP in 2001"] = data2001["gdp"].rank(ascending=False)
df["Rank by GDP in 2018"] = data2018["gdp"].rank(ascending=False)

Change in CO2 emission ¶

In [10]:
print("Top 10 country to reduce CO2 emission")
df.sort_values(by="Change in CO2 emission (%)", ascending=True).dropna()[:10]
Top 10 country to reduce CO2 emission
CO2 emission in 2001 CO2 emission in 2018 Change in CO2 emission (%) Rank by GDP in 2001 Rank by GDP in 2018
Malta 2.648 1.547 -41.578550 136.0 137.0
North Macedonia 11.926 7.031 -41.044776 116.0 123.0
Venezuela 171.975 102.672 -40.298299 27.0 52.0
Denmark 55.896 34.725 -37.875698 44.0 57.0
Yemen 16.017 10.474 -34.606980 63.0 91.0
United Kingdom 577.971 379.730 -34.299472 7.0 9.0
North Korea 71.664 47.630 -33.537062 83.0 106.0
Greece 105.362 71.782 -31.871073 39.0 60.0
Finland 62.514 45.796 -26.742810 46.0 61.0
Italy 470.568 349.005 -25.833248 8.0 10.0
In [11]:
print("Top 10 country to increase CO2 emission")
df.sort_values(by="Change in CO2 emission (%)", ascending=False).dropna()[:10]
Top 10 country to increase CO2 emission
CO2 emission in 2001 CO2 emission in 2018 Change in CO2 emission (%) Rank by GDP in 2001 Rank by GDP in 2018
Congo 0.605 6.596 990.247934 123.0 120.0
Afghanistan 1.069 10.818 911.973807 129.0 93.0
Cambodia 2.250 14.388 539.466667 105.0 98.0
Mongolia 7.804 45.316 480.676576 137.0 104.0
Burkina Faso 0.991 4.948 399.293643 117.0 116.0
Vietnam 59.654 274.223 359.689208 40.0 31.0
Nepal 3.236 14.833 358.374536 79.0 86.0
Mozambique 1.554 7.080 355.598456 107.0 121.0
Benin 1.689 7.434 340.142096 122.0 126.0
Chad 0.502 2.007 299.800797 138.0 117.0

To support our hypothesis, we will need to analyze the relationship between CO2 emissions and GDP. However, we currently do not have information on GDP for the year 2021. Therefore, we will use data from 2018 as a proxy for our analysis.

After sorting the data by the change in CO2 emissions, we can easily observe whether there is any relationship between changes in CO2 emissions and a country's GDP. It is clear that countries with a higher negative change in CO2 emissions have a relatively good GDP rank in both 2001 and 2018, as compared to countries with highly positive changes.

It is worth noting that in countries with a higher positive change in CO2 emissions, only one country (Vietnam) has a significant contribution to the overall CO2 emissions.

Top contributors of CO2 emission ¶

In [12]:
print("Top 10 CO2 emission contributors of 2001")
top_countributor = df.loc[data2001.sort_values("co2", ascending=False)[:10].index]
top_countributor
Top 10 CO2 emission contributors of 2001
CO2 emission in 2001 CO2 emission in 2018 Change in CO2 emission (%) Rank by GDP in 2001 Rank by GDP in 2018
country
United States 5911.988 5376.657 -9.055008 1.0 2.0
China 3723.731 10353.877 178.051154 2.0 1.0
Japan 1249.989 1143.412 -8.526235 3.0 4.0
India 991.732 2600.447 162.212674 4.0 3.0
Germany 916.144 754.408 -17.653993 5.0 5.0
United Kingdom 577.971 379.730 -34.299472 7.0 9.0
Canada 558.778 584.369 4.579815 13.0 14.0
Italy 470.568 349.005 -25.833248 8.0 10.0
South Korea 455.631 670.169 47.085909 14.0 12.0
France 411.614 322.527 -21.643336 6.0 8.0

Upon analyzing the top contributors to CO2 emissions, we can see that the United Kingdom, Italy, and France, all of which are well-developed countries, have shown the most negative change in emissions. In contrast, developing countries like India and China have demonstrated the most positive change. This observation strengthens our earlier hypothesis that developed countries may have a harder time reducing their emissions compared to developing countries, which prioritize economic growth.

Additionally, it's worth noting that each of the top contributors has a high GDP ranking, providing further evidence to support our second hypothesis that higher GDP tend to have higher CO2 emissions.

In [13]:
top_country = list(top_countributor.index)
top_country_data = filtered_country_data[filtered_country_data["country"].apply(lambda x: x in top_country)]
fig = px.bar(top_country_data, x="country", y="co2", color="country", animation_frame="year", animation_group="country",title="CO2 emmisions over time for top countries")
fig.show()

Correlation between CO2 emission and GDP ¶

In [14]:
temp = filtered_country_data[filtered_country_data["year"]<=2018]
temp = temp.groupby("country")["co2"].corr(temp["gdp"])
px.scatter(temp, y="co2", title="Correlation between CO2 emission and GDP for all countries", labels={"co2":"Correlation Value"})
In [15]:
print("Corelation between world GDP and global CO2 emission:",world_data['gdp'].corr(world_data['co2']))
Corelation between world GDP and global CO2 emission: 0.9719771944145315

We can observe that in most countries, there is a fairly high correlation between CO2 emissions and GDP. This also supports our hypothesis that country with higher GDP has higher CO2 emission. Moreover overall corelation between wrold GFP and global CO2 emission is 0.97 which is significant high. Some developed countries have highly negative correlation which are United Kingdom, Germany and France are developed countries and trieing to reduce the CO2 emission, which supports our hypothesis.

Effect of Natural Resources on CO2 emission ¶

Hypothesis ¶

We can make hypothesis that countries with more natural resources have more more CO2 emission.

This can be verified by looking at the rank of CO2 emission for the countries with more natural resources.

In [16]:
# https://www.investopedia.com/articles/markets-economy/090516/10-countries-most-natural-resources.asp
country_with_natural_resources = ["United States", "Saudi Arabia", "Canada", "China", "Brazil", "Australia", "Iraq", "Venezuela"]

We don't have data to qunatify the amount of natural resourses, that would have been useful to draw a proper correlation. But We selected top countries with natural resources.

In [17]:
df = pd.DataFrame(index=country_with_natural_resources)
data2001 = filtered_country_data[filtered_country_data["year"]==2001].set_index("country", drop=True)
data2018 = filtered_country_data[filtered_country_data["year"]==2018].set_index("country", drop=True)
df["CO2 emission in 2001"] = data2001["co2"]
df["CO2 emission in 2018"] = data2018["co2"]
df["Rank by CO2 emission in 2001"] = data2001["co2"].rank(ascending=False)
df["Rank by CO2 emission in 2018"] = data2018["co2"].rank(ascending=False)
print("Top countries with natural resources, with rank by GDP in 2001 and 2018")
df
Top countries with natural resources, with rank by GDP in 2001 and 2018
CO2 emission in 2001 CO2 emission in 2018 Rank by CO2 emission in 2001 Rank by CO2 emission in 2018
United States 5911.988 5376.657 1.0 2.0
Saudi Arabia 296.588 626.191 19.0 7.0
Canada 558.778 584.369 7.0 9.0
China 3723.731 10353.877 2.0 1.0
Brazil 346.166 477.102 14.0 10.0
Australia 357.132 416.284 13.0 14.0
Iraq 84.556 213.431 37.0 27.0
Venezuela 171.975 102.672 24.0 37.0

From above table we can observe that top countries with more natural resources have significantly high rank by CO2 emission in 2001 as well as in 2018.

Effect of Policies on CO2 emission ¶

Hypothesis ¶

We can put hypothesis that with the use of renewable energy and good gourvemnt policies we can reduce CO2 emission.

This can be analyised by case studies.

United Kingdom ¶

In [18]:
uk_data = filtered_country_data[filtered_country_data["country"] == "United Kingdom"][["year","co2"]]
px.line(uk_data, x="year", y="co2", title="CO2 emission in United Kingdom")

In united kingdom, CO2 emission is significantly reducing. This are due to various reasons like Renewable Energy, Energy Efficiency, Climate Change Policies, etc.

UK has several policies such as Climate Change Act to reduce sets legally binding emission reduction targets, and the Clean Growth Strategy. UK has also put cap on amount of CO2 industries can emit and increased renewable energy sources to cut the CO2 emission to produce energy.

This Climate Change Act was introduced in 2008 which result in drastic change in 2009.

United States ¶

In [19]:
uk_data = filtered_country_data[filtered_country_data["country"] == "United States"][["year","co2"]]
px.line(uk_data, x="year", y="co2", title="CO2 emission in United States")

Just like United Kingdom, US also moved towards renewable energy and Shift from coal to natural gas. USA have policies like Regional Greenhouse Gas Initiative, which is a cap-and-trade program for CO2 emissions in the Northeastern USA.

We can also observe drastic drop in CO2 emission in 2009, that is due to economic cries in 2008.

Conclusion ¶

In conclusion, our analysis indicates a correlation between a country's GDP and its CO2 emissions, with higher GDP values often corresponding to greater levels of emissions. Furthermore, our observations suggest that developed countries are generally making efforts to reduce their CO2 emissions, resulting in more negative changes, while developing countries may prioritize economic growth over reducing emissions. Overall, this underscores the need for continued efforts to balance economic growth with environmental sustainability.

It's well established that countries that rely heavily on natural resources for economic development, such as those with significant oil, gas, and coal reserves, tend to have higher levels of CO2 emissions. As we observed earlier, the coal sector is a significant contributor to global CO2 emissions. Therefore, transitioning towards renewable sources of energy is essential not only to reduce greenhouse gas emissions but also to address the finite nature of natural resources.

As we have seen in the cases of the United Kingdom and the United States, the use of renewable energy sources and effective policies to control CO2 emissions can be instrumental in reducing carbon emissions.